package net.kts.subskill.airport;

import net.kts.main.R;
import net.kts.transrate.TranslateService;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

/*
 * 김포공항 메인
 */
public class GimpoAirport extends Activity {
	
	private String[] strArray = {"1F", "2F", "3F", "4F"};

	// 김포공항 국제선 사진
	private int[] idGimpoGArray = {
			R.drawable.airport_facility01_img01,
			R.drawable.airport_facility01_img02,
			R.drawable.airport_facility01_img03,
			R.drawable.airport_facility01_img04
	};
	
	// 김포공항 국내선 사진 url
	private int[] idGimpoCArray = {
			R.drawable.airport_facility02_img01,
			R.drawable.airport_facility02_img02,
			R.drawable.airport_facility02_img03,
			R.drawable.airport_facility02_img04
	};

	// 갤러리 액티비티 실행
	public void startGallery(int position, int[] idArray){
		Intent intent = new Intent(GimpoAirport.this, LocalGalleryDetail.class);
		intent.putExtra("position", position);
		intent.putExtra("idArray", idArray);
		intent.putExtra("strArray", strArray);
		startActivity(intent);
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.airport_gimpo_main);

		// 1. 국제선
		TextView tv = (TextView) findViewById(R.id.tv_gimpo_label1);
		String gimpoLabel1 = "International flight";
		tv.setText(TranslateService.translateRepository(gimpoLabel1));
		
		// 1층 
		Button btnGOne = (Button)findViewById(R.id.btn_g_one);
		btnGOne.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				startGallery(0, idGimpoGArray);
//				Intent intent = new Intent(GimpoAirport.this, LocalGalleryDetail.class);
//				intent.putExtra("position", 0);
//				intent.putExtra("idArray", idGimpoGArray);
//				startActivity(intent);
			}
		});
		// 2층
		Button btnGTwo = (Button)findViewById(R.id.btn_g_two);
		btnGTwo.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				startGallery(1, idGimpoGArray);
			}
		});
		// 3층 
		Button btnGThree = (Button)findViewById(R.id.btn_g_three);
		btnGThree.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				startGallery(2, idGimpoGArray);
			}
		});
		// 4층
		Button btnGFour = (Button)findViewById(R.id.btn_g_four);
		btnGFour.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				startGallery(3, idGimpoGArray);
			}
		});

		// 2. 국내선
		TextView tv2 = (TextView) findViewById(R.id.tv_gimpo_label2);
		String gimpoLabel2 = "Domestic flight";
		tv2.setText(TranslateService.translateRepository(gimpoLabel2));
		
		// 1층 
		Button btnCOne = (Button)findViewById(R.id.btn_c_one);
		btnCOne.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				startGallery(2, idGimpoCArray);
			}
		});
		// 2층
		Button btnCTwo = (Button)findViewById(R.id.btn_c_two);
		btnCTwo.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				startGallery(2, idGimpoCArray);
			}
		});
		// 3층 
		Button btnCThree = (Button)findViewById(R.id.btn_c_three);
		btnCThree.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				startGallery(2, idGimpoCArray);
			}
		});
		// 4층
		Button btnCFour = (Button)findViewById(R.id.btn_c_four);
		btnCFour.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				startGallery(2, idGimpoCArray);
			}
		});
	}
}
